package atomic

import "sync/atomic"

//Boolean is a boolean value 
type Boolean uint32

func (b *Boolean) Get() bool {
	return atomic.LoadUint32((*uint32)(b)) != 0
}

//Set writes the value atomically
func (b *Boolean) Set(v bool) {
	if v {
		atomic.StoreUint32((*uint32)(b),1)
	} else {
		atomic.StoreUint32((*uint32)(b),0)
	}
}